package com.barry.importfile;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 类功能描述：//TODO
 *
 * @author WangXueXing create at 19-3-15 下午3:46
 * @version 1.0.0
 */
public class ProcessDataByPostgisListeners extends ReaderFileListener {
    private final Logger LOGGER = LoggerFactory.getLogger(ProcessDataByPostgisListeners.class);
    @Override
    public void output(List<String> stringList) throws Exception {
//        System.out.println(stringList.size());
        System.out.println("==================================");
        List<List<String>> dataList = stringList.stream()
                .map(x->Arrays.asList(x.split(",")).stream().map(String::trim).collect(Collectors.toList()))
                .collect(Collectors.toList());
        dataList.forEach(x-> LOGGER.info(x.get(7)));
    }

    @Override
    public String getEncode(){
       return ReadFile.CHARSET;
    }
}
